minor tweaks (#1669)

* avoid unnecesary method pollution

* production.rake typo fix

* remove un-used local variable assignment

Karol Bucek 8 years ago
parent
commit
8ca39a5802
3 changed files with 6 additions and 8 deletions
  1. 1 1
      app/models/agents/website_agent.rb
  2. 4 6
      config/initializers/delayed_job.rb
  3. 1 1
      lib/tasks/production.rake

+ 1 - 1
app/models/agents/website_agent.rb

@@ -443,7 +443,7 @@ module Agents
443 443
     end
444 444
 
445 445
     def use_namespaces?
446
-      if value = interpolated.key?('use_namespaces')
446
+      if interpolated.key?('use_namespaces')
447 447
         boolify(interpolated['use_namespaces'])
448 448
       else
449 449
         interpolated['extract'].none? { |name, extraction_details|

+ 4 - 6
config/initializers/delayed_job.rb

@@ -16,12 +16,10 @@ class Delayed::Job
16 16
   scope :failed, -> { where("failed_at IS NOT NULL") }
17 17
 end
18 18
 
19
-def database_deadlocks_when_using_optimized_strategy?
19
+database_deadlocks_when_using_optimized_strategy = lambda do
20 20
   ENV["DATABASE_ADAPTER"] == "mysql2"
21 21
 end
22 22
 
23
-if database_deadlocks_when_using_optimized_strategy?
24
-  Delayed::Backend::ActiveRecord.configure do |config|
25
-    config.reserve_sql_strategy = :default_sql
26
-  end
27
-end
23
+Delayed::Backend::ActiveRecord.configure do |config|
24
+  config.reserve_sql_strategy = :default_sql
25
+end if database_deadlocks_when_using_optimized_strategy.call

+ 1 - 1
lib/tasks/production.rake

@@ -34,7 +34,7 @@ namespace :production do
34 34
   end
35 35
 
36 36
   task :start => :check do
37
-    puts "Startig huginn ..."
37
+    puts "Starting huginn ..."
38 38
     run_sv('start')
39 39
   end
40 40